VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "LCategoria"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
'---------------------------------------------------------------------------------------
' Module    : LCategoria
' DateTime  : 30/11/2011 12:14
' Author    :
' Purpose   : Clase Logica Negocio Categoria
'---------------------------------------------------------------------------------------
Option Explicit
Dim dao As DAOCategoria
Dim logDAO As DAOLog
Private Const MODULO As String = "CATEGORIA"
Private Sub Class_Initialize()
Set dao = New DAOCategoria
Set logDAO = New DAOLog
End Sub
Public Function getBean(ByVal bean As bCategoria, ByRef error As Integer) As bCategoria
Dim result As bCategoria
Set dao.Connection = utilConexion
Set result = dao.getBean(bean)
If Not result Is Nothing Then
    Set getBean = result
Else
    capturarError UtilConstantes.STR_OBTENER
End If
End Function
Public Function getLista(bean As bCategoria, ByRef bpaginador As bpaginador, ByRef error As Integer) As Collection
Dim result As Collection
Set dao.Connection = utilConexion
Set result = dao.getLista(bean, bpaginador)
If Not result Is Nothing Then
    Set getLista = result
Else
    capturarError UtilConstantes.STR_LISTAR
    error = UtilConstantes.OPT_ERROR_ENCONTRADO
End If
hnderr:
If Err.Number = 0 Then Exit Function
capturarError UtilConstantes.STR_LISTAR
End Function
Private Sub capturarError(opcion As String)
Set bLog.busuario = bparametro.bUsuarioActivo
bLog.sOpcion = opcion
bLog.sModulo = MODULO
If bConfiguracion.guardarHistorialSucesos Then
    Set logDAO.Connection = utilConexion
    logDAO.guardarNuevo bLog
End If
If bConfiguracion.enviarMailSuceso Then
    'TO DO
End If
Set bLog = Nothing
End Sub
